// 创建一个路由器，并暴露出去
// 第一步：引入createRouter
import {createRouter, createWebHistory} from 'vue-router'
// 引入一个一个可能要呈现组件
import Layout from '@/views/Layout.vue'
import Login from '@/views/Login.vue'
import User from '@/views/User.vue'
import Auth from '@/views/Auth.vue'
import Dept from '@/views/Dept.vue'
import Info from "@/views/Info.vue";
import Apply from "@/views/Apply.vue";
import Audit from "@/views/Audit.vue";
import Reim from "@/views/Reim.vue";
import NormalOperlog from "@/views/NormalOperlog.vue";
import AbnormalOperlog from "@/views/AbnormalOperlog.vue";
import Loginlog from "@/views/Loginlog.vue";
import Notice from "@/views/Notice.vue";
import Inform from "@/views/Inform.vue";
import Chart from "@/views/Chart.vue";
import LeftMenu from "@/components/LeftMenu.vue";

//创建路由器
const router = createRouter({
	history: createWebHistory(),
	routes: [
		{path: '/login', component: Login},
		{
			path: '/', component: Layout, children: [
				{path: '/chart', component: Chart},
				{path: '/user', component: User},
				{path: '/auth', component: Auth},
				{path: '/dept', component: Dept},
				{path: '/info', component: Info},
				{path: '/apply', component: Apply},
				{path: '/reim', component: Reim},
				{path: '/audit', component: Audit},
				{path: '/notice', component: Notice},
				{path: '/inform', component: Inform},
				{path: '/operLog', component: NormalOperlog},
				{path: '/abnormalOperLog', component: AbnormalOperlog},
				{path: '/loginlog', component: Loginlog},
				{path: '/leftMenu', component: LeftMenu},
			]
		}
	]
})

// 暴露出去router
export default router